import request from "@/utils/request.js";

// 会员列表
export function pages(data) {
  return request.get('/campus/memberInfo/app/page',data);
}


// 获得基本信息
export function getUserInfo() {
  return request.get('/campus/memberInfo/app/getLoginUserInfo');
}

// 修改基本信息
export function updateUser(data) {
  return request.put('/campus/memberInfo/app/updateUserInfoForBase', data);
}

/**
 * 修改学校
 * @param data
 * @returns {*}
 */
export function updateSchool(data) {
  return request.post('/campus/memberInfo/app/updateSchool', data);
}

// 修改用户手机
export function updateUserMobile(data) {
  return request.put('/campus/memberInfo/app/update-mobile', data);
}

// 修改用户密码
export function updateUserPassword(data) {
  return request.put('/campus/memberInfo/app/update-password', data);
}

// 重置密码
export function resetUserPassword(data) {
  return request.put('/campus/memberInfo/app/reset-password', data, {
    noAuth: true
  });
}

// 获取用户账户余额
export function accountInfo() {
  return request.get('/campus/memberInfo/app/accountInfo',null,  {
    noAuth: false
  });
}

// 订单收益明细
export function getUserOrderProfitRecord(data) {
  return request.get('/campus/userSettlementInfo/app/page',data,  {
    noAuth: false
  });
}

// 学生认证
export function studentCert(data) {
  return request.post('/campus/memberInfo/app/studentCert', data, {
    noAuth: false
  });
}

// 获取常用地址
export function getUseAddress(data) {
  return request.get('/campus/memberAddress/use', data, {
    noAuth: false
  });
}

// 获取邀请码
export function getInviteCode(data) {
  return request.post('/campus/memberInfo/app/createInviteCode', data, {
    noAuth: false
  });
}

// 获取管理员权限列表
export function getPermissions(data) {
  return request.post('/campus/memberInfo/app/getPermissions', data, {
    noAuth: false
  });
}

// 保存用户权限
export function setMemberPermits(data) {
  return request.put('/campus/memberInfo/app/setMemberPermits', data, {
    noAuth: false
  });
}

// 设置代理
export function setAgent(data) {
  return request.put('/campus/memberInfo/app/setAgent', data, {
    noAuth: false
  });
}

// 获取权限学校
export function getPermisSchool(data) {
  return request.get('/campus/memberInfo/app/school', data, {
    noAuth: false
  });
}

// 获取邀请人收益
export function getCommissionRule(data) {
  return request.get('/campus/commissionRule/app/list', data, {
    noAuth: false
  });
}

// 获取我的邀请人
export function getLowerChain(data) {
  return request.get('/campus/memberInfo/app/getLowerChain', data, {
    noAuth: false
  });
}
